<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition template="/pages/common/layout.xhtml">
            <ui:define name="content">
                <h:form id="form">
                    <h:outputText value="ID" /> <h:inputText id="input" value="" />
                    <h:outputText value="Name" /> <h:inputText id="input1" value="" />
                    <h:outputText value="Address" /> <h:inputText id="input2" value="" />
                    <h:outputText value="Phone" /> <h:inputText id="input3" value="" />
                    <h:commandButton value="Submit" action="#{clientBean.submit()}"/>
                </h:form>
                <h:dataTable value="#{clientBean.clientBus.clientDaoImpl.clients}" var="client">
                    <h:column>    				
                        <f:facet name="header">Id</f:facet>    				
                            #{client.id}
                    </h:column>
                    <h:column>
                        <f:facet name="header">Name</f:facet>
                            #{client.name}
                    </h:column>
                    <h:column>
                        <f:facet name="header">Address</f:facet>
                            #{client.address}
                    </h:column>
                    <h:column>
                        <f:facet name="header">Phone</f:facet>
                            #{client.phoneNumber}
                    </h:column>
                    <h:column>
                        <f:facet name="header">Email</f:facet>
                            #{client.email}
                    </h:column>
                    <h:column>
                        <f:facet name="header">Number of Contracts</f:facet>
                            #{client.apartmentContracts.size()}
                    </h:column>
                </h:dataTable>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

